<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>JpetStore</title>
    <link rel="stylesheet" href="../css/jpetstore.css" type="text/css"/>
    <link rel="stylesheet" href="../css/jquery-ui.css" type="text/css"/>
    <script th:src = "@{/JS/jquery-3.2.1.js}"></script>
    <script th:src = "@{/JS/jquery-ui.js}"></script>
</head>
<body>
    <div th:replace="/common/header.html"></div>
    <div id="Content">
        <h2>My Orders</h2>

        <div>
            <a href="/catalog/main">回到主页面</a>
        </div>

        <table id="listOrderTable">
            <tr>
                <th>Order ID</th>
                <th>Date</th>
                <th>Total Price</th>
                <th>Status</th>
                <th>是否发货</th>
            </tr>
            <tr th:each="order:${orderList}">
                <td>
                    <a th:href="@{'/order/viewOrderInOrderList?orderId='+${order.getOrderId()}}" th:text="${order.getOrderId()}"></a>
                </td>
                <td th:text="${order.orderDate}"></td>
                <td th:text="${order.totalPrice}"></td>
                <td th:if="${order.getisBuy() eq '0'}">
                    <a th:href="@{'/order/buyOrder?orderId='+${order.orderId}}">此订单还没有支付,点此处进行支付</a>
                </td>
                <td th:if="${order.getisBuy() eq '1'}">
                    此订单已经完成支付
                </td>
                <td th:if="${order.getDeliver() eq '0'}">
                    订单还未发货
                </td>
                <td th:if="${order.getDeliver() eq '1'}">
                    <a th:href="@{'/order/viewDeliver?orderId='+${order.getOrderId()}}">此订单已经发货点击查看物流信息</a>
                </td>
            </tr>
        </table>
    </div>
    <div th:replace="/common/footer.html"></div>
</body>
</html>